package com.bmp.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.bmp.dao.ProjectDao;
import com.bmp.model.Project;
import com.bmp.model.vo.ProjectVoProStatus;
import com.bmp.service.ProjectManager;

@Component("projectManager")
public class ProjectManagerImpl implements ProjectManager {
	private ProjectDao projectDao;

	public ProjectDao getProjectDao() {
		return projectDao;
	}

	@Resource
	public void setProjectDao(ProjectDao projectDao) {
		this.projectDao = projectDao;
	}

	public void addProject(Project p) {
		this.projectDao.insertProject(p);
	}

	public void deleteProjectById(int id) {
		this.projectDao.deleteProjectById(id);
	}

	public Project getProjectById(int id) {
		return this.projectDao.getProjectById(id);
	}

	public void updateProject(Project p) {
		this.projectDao.updateProject(p);
	}

	public List<ProjectVoProStatus> getProject(int page, int rows) {
		return this.projectDao.getProject(page, rows);
	}

	public int getTotalPages() {
		return this.projectDao.getTotalPages();
	}

	public List<Project> getAllProjects() {
		System.out.println("getAllProjects");
		return this.projectDao.getAllProjects();
	}

}
